﻿using yDevice.Enum;
using yDevice.Interface;

namespace yDevice.AirConditioningUnit
{
    public class Actuator : IDevice
    {

        public int Number { get; set; }
        public string Name { get; set; }


        public double RealCurrent { get; set; }
        public double RealVoltage { get; set; }

        public double RunTimeout { get; set; }

        public bool IsRunning { get; set; }

        public Actuator(int number)
        {
            Number = number;
        }
        /// <summary>
        /// 执行器旋转
        /// </summary>
        /// <param name="direction">旋转方向：正转：CW； 反转：CCW；不转：None</param>
        public virtual void Rotate(Direction direction)
        {
            IsRunning = false;
        }

        /// <summary>
        /// 执行器到达指定的电压区间位置
        /// </summary>
        /// <param name="volMin"></param>
        /// <param name="volMax"></param>
        /// <returns></returns>
        public virtual bool InPosition(double volMin, double volMax) => RealVoltage >= volMin && RealVoltage <= volMax;
    }
}
